<?php include PATH_TPL."/admin/tpl.header.phtml"?>
<div class="main-container inner">
    <div class="main-content">
        <div class="container-fluid">
            <div class="row bt">
                <div class="col-lg-12 bg">
                    <ol class="breadcrumb">
                        <li class="active">
                            <i class="fa  fa-fw fa-reorder"></i>分类管理
                        </li>
                    </ol>
                </div>
            </div>
            <div class="row">
                <div class="col-md-6">
                    <a class="btn btn-success" href="/admin_category/add">添加分类</a>
                </div>
                <div class="col-md-6">
                    <form method="post" action="/admin_category">
                        <div class="form-group input-group">
                            <input type="text" placeholder="输入分类标题或者别名关键词搜索" name="key" class="form-control">
                        <span class="input-group-btn">
                          <button type="button" class="btn btn-default" id="search"><i class="fa fa-search"></i></button>
                        </span>
                        </div>
                    </form>
                </div>
            </div>

            <div class="panel-body text-center">
                <table class="table table-hover" id="sample-table-1">
                    <thead>
                        <tr>
                            <td>编号</td>
                            <td>标题</td>
                            <td>关键字</td>
                            <td>描述</td>
                            <td>操作</td>
                        </tr>
                    </thead>
<?foreach($tDatas as $tRow){?>
                    <tr>
                    <td><?=$tRow['id']?></td>
                    <td> <?=empty($tRow['html'])?'':$tRow['html']?><?=$tRow['title']?></td>
                    <td> <?=empty($tRow['keywords'])?'':$tRow['keywords']?></td>
                    <td> <?=empty($tRow['description'])?'':$tRow['description']?></td>
                        <td>
                            <div class="visible-md visible-lg hidden-sm hidden-xs">
                            <a href="/admin_category/edit?id=<?=$tRow['id']?>" class="btn btn-blue btn-xs tooltips" data-placement="top" data-original-title="编辑"><i class="fa fa-edit"></i></a>
                            <a href="#" onclick="cg_confirm_del('/admin_category/del?id=<?=$tRow['id']?>','/admin_category')" class="btn btn-orange btn-xs tooltips demo_4" data-placement="top" data-origina-title="删除"><i class="fa fa-times"></i></a>
                            </div>
                            <div class="visible-xs visible-sm hidden-md hidden-lg">
                                <div class="btn-group">
                                    <a class="btn btn-green dropdown-toggle btn-sm" data-toggle="dropdown" href="#">
                                        <i class="fa fa-cog"></i> <span class="caret"></span>
                                    </a>
                                    <ul role="menu" class="dropdown-menu pull-right dropdown-dark">
                                        <li>
                                            <a role="menuitem" tabindex="-1" href="/admin_category/edit?id=<?=$tRow['id']?>">
                                                <i class="fa fa-edit"></i>编辑 
                                            </a>
                                        </li>
                                        <li>
                                            <a role="menuitem" tabindex="-1" href="#" onclick="cg_confirm_del('/admin_category/del?id=<?=$tRow['id']?>','/admin_category')">
                                                <i class="fa fa-times"></i>删除
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </td>
<?}?>
                    </tr>
                </table>
            </div>
        </div>
        <div class="subviews">
            <div class="subviews-container"></div>
        </div>
    </div>
    <!-- end: PAGE -->
</div>
<!-- end: MAIN CONTAINER -->

<script>
$('#search').click(function(){
    $('form').submit();
});
</script>
<?php include PATH_TPL."/admin/tpl.footer.phtml"?>
